﻿<!DOCTYPE html>
<html>
<head>
    <title>表单处理</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <link href="/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/animate.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/index.css?v=1">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/default.css">
    <link href="/ViewV5/JS/element/index.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/FORMBI.css?v=3">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_533449_zsibbu1n60f.css">

    <style>
        .iconfont {
            margin-right: 4PX;
            font-size: 18px;
        }

        .widthmax {
            width: 100%;
        }

        .pd40 {
            padding: 40px;
        }

        .pd0 {
            padding: 0;
        }

        .disdiv {
            margin-left: 10PX;
        }

        .el-message-box {
            width: 320px !important;
        }
    </style>

</head>
<body class="BG">
    <div id="Loading">
        <div class="loader-inner ball-beat">
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <div id="DATABI_YBZZ" class="FormV" style="display:none">
        <el-container>
            <el-main class="elmain pd40">

                <div class="panel-df " id="princontent">
                    <div class="container containerb" v-bind:class="{ width840: poption.width=='0'}" style="padding:0;    box-shadow: 0 8px 18px 0 rgba(0,0,0,.1);">
                        <div class="panel panel-defaul  panhead" style="border: 1px solid #ebeef5;padding-bottom: 10px;">
                            <div class="success-tip" v-show="pidata.isGD=='Y'&&vtype == '0'" style="width: 100px;right: 25%;left: auto;">
                                已归档
                            </div>
                            <div class="success-tip" v-show="pidata.isComplete=='Y'&&vtype == '0'" style="width: 120px;left: 30%;right: auto;">
                                流程已结束
                            </div>

                            <el-row>

                                <el-col :xs="24" :sm="24">
                                    <h4 class="text-center">
                                        <span v-text="pddata.ProcessName" style="font-size: 24PX;font-family: cursive;font-weight: 700;"></span>
                                        <el-tooltip class="item" effect="dark" content="表单填写说明" placement="top-start">
                                            <i class="el-icon-question hidden-print" style="color: cornflowerblue;" @click="FormDecVisible = true"></i>
                                        </el-tooltip>
                                        <el-dropdown style="float:right;" @command="handleCommand" class="hidden-print">
                                            <i class="el-icon-more el-dropdown-link"></i>
                                            <el-dropdown-menu slot="dropdown">
                                                <!--<el-dropdown-item command="CopyForm">重新发起</el-dropdown-item>
                                                <el-dropdown-item command="UpdateTemp">更新模板</el-dropdown-item>-->
                                                <el-dropdown-item v-if="vtype!='1'" command="Export">导出Word</el-dropdown-item>
                                                <!--<el-dropdown-item v-if="vtype!='1'" command="Preview">打印</el-dropdown-item>-->
                                                <el-dropdown-item v-if="vtype!='1'" command="qp">全屏</el-dropdown-item>
                                                <el-dropdown-item v-if="vtype!='1'" command="zdh">最大化</el-dropdown-item>


                                            </el-dropdown-menu>
                                        </el-dropdown>
                                    </h4>
                                    <p style="text-align:center; margin-top: 10px;color: gray;font-family: cursive;">发起人：【{{pidata.BranchName}}】{{pidata.CRUserName}} <span style="    position: absolute;right: 0px;" v-show="vtype == '0'" v-text="pidata.CRDate"></span> </p>

                                </el-col>

                            </el-row>


                        </div>
                        <div class="panel panel-default panbody" style="padding-bottom: 0PX;padding-top: 0PX;" :style="{'margin-bottom':pddata.ProcessType=='-1'?'80px':'0px' }">
                            <div class="success" v-show="formtatus =='1'">
                                <div class="success-tip">
                                    操作信息提示
                                    <i></i>
                                </div>
                                <div class="icon-tip">
                                    <div class="success-icon">
                                        <img src="/ViewV5/images/xt-right.png" />
                                    </div>
                                    <p></p>
                                </div>

                                <div class="tip-mesg">
                                    <el-button type="primary" icon="el-icon-view" style="border-radius:0px;" @click="ref()">查看该表单</el-button>
                                </div>
                            </div>
                            <el-row v-show="formtatus =='0'">
                                <el-form ref="form" label-position="top" :model="FormData">
                                    <component class="widget" v-for="(item, index) in FormData.wigetitems" :key="item.wigdetcode" :is="item.component" :index="index" :id="item.wigdetcode" :pzoption="item" style="margin-top:10px"></component>
                                </el-form>
                            </el-row>

                        </div>
                        <!--<div class="panel panel-default panwf" v-if="pddata.ProcessType=='1'" style="margin-bottom: 0px;">
                            <el-steps finish-status="success" align-center>
                                <el-step v-for="item in wfdata" :title="item.TaskName+'--'+item.TaskAssInfo" :status="stepstatus(item.state)">
                                    <span slot="description"> {{item.EndTime}}：{{item.userrealname}}<br /> {{item.TaskUserView}}</span>

                                </el-step>
                            </el-steps>
                        </div>-->
                        <div class="panel panel-default panwf" v-if="pddata.ProcessType=='1'" :style="{'margin-bottom':vtype=='0'?'0px':'80px' }">

                            <el-button type="text" @click="lcshow=!lcshow" style="margin-left: 5px;" v-text="lcshow?'隐藏流程':'显示流程'"><i class="el-icon-arrow-right el-icon--right"></i></el-button>
                            <el-collapse-transition>

                                <el-timeline v-show="lcshow">
                                    <el-timeline-item placement="top" v-for="(item, index) in wfdata" :timestamp="(index+1)+'：'+item.TaskName+'--'+item.TaskAssInfo" :type="stepstatus(item.state)">
                                        <el-card v-if="item.TIData.length>0||item.RBData.length>0" shadow="hover">
                                            <p v-for="ti in item.RBData" style="margin-top: 5px;color: #ff6a00;">【{{ti.IsHasManager}}】<span v-text="ti.TaskUser"></span> ：{{ti.UserView}} <span style="float:right" v-text="ti.Crdate"></span></p>
                                            <p v-for="ti in item.TIData" style="margin-top: 5px;color: #67c23a;"><span v-text="ti.zhuandanto"></span> ：{{ti.TaskUserView}} <span style="float:right" v-text="ti.EndTime"></span></p>

                                        </el-card>
                                    </el-timeline-item>
                                </el-timeline>
                            </el-collapse-transition>

                        </div>
                        <div class="panel panel-default panwf" id="FormFoot" style="padding-bottom: 20px;margin-bottom: 0px;">
                            <el-row>
                                <el-col :xs="24" :sm="12" v-show="qxdata.ISCANSP=='Y'&&tdpro.zhuandan">
                                 

                                </el-col>
                                <el-col :xs="24" :sm="tdpro.zhuandan?12:24">
                                    <div style="text-align:right;" class="hidden-print">
                                        <el-button size="small" type="danger" v-on:click="CanCel" style="border-radius:0px;"><i class="iconfont icon-chexiao1"></i>删除表单</el-button>
                                        <el-button size="small" type="success" v-on:click="SaveForm"  style="border-radius:0px;">  <i class=" iconfont icon-gzbg"></i>  更新表单</el-button>

                                    </div>

                                </el-col>

                            </el-row>
                        </div>

                    </div>

                </div>
            </el-main>
        </el-container>

        <el-dialog title="表单填写说明" :visible.sync="FormDecVisible">
            <div v-html="pddata.Alias">

            </div>
            <table class="table table-bordered table-hover" v-if="FormFile.length>0">
                <tr><th>附件</th></tr>
                <tr v-for="file in FormFile">
                    <td><a style="color:dodgerblue" v-bind:href="ComFunJS.getfile(file.ID)" v-text="file.Name"></a></td>
                </tr>
            </table>


            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="FormDecVisible = false">关 闭</el-button>
            </div>
        </el-dialog>

        <el-dialog title="退回" :visible.sync="dialogCanVisible" id="candiv">
            <el-form>
                <el-form-item label="退回意见">
                    <el-input v-model="canyj" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="退回类型">
                    <el-radio-group v-model="canlx" style="width:100%">
                        <el-radio label="0" v-show="!tdpro.nocal">退回</el-radio>
                        <el-radio label="1" v-show="!tdpro.nocalre">退回到上一步</el-radio>
                    </el-radio-group>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogCanVisible = false">取 消</el-button>
                <el-button type="primary" @click="ConReBack">确 定</el-button>
            </div>
        </el-dialog>

    </div>
    <script src="/ViewV5/JS/vue.js"></script>
    <script type="text/javascript" src="/ViewV5/JS/jquery-1.11.2.min.js"></script>
    <script src="/ViewV5/JS/lodash.min.js"></script>
    <script src="/ViewV5/JS/httpVueLoader.js"></script>
    <script src="/ViewV5/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
    <!-- 引入组件库 -->
    <script src="/ViewV5/JS/element/element.js"></script>
    <script src="/ViewV5/JS/bijs.js?v=11"></script>
    <script src="/ViewV5/JS/Print.js?v=2"></script>
    <script type="text/javascript" charset="utf-8" src="/ToolS/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/ToolS/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.umd.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.min.css">


    <script>
        function Preview() {
            $("#princontent").printThis({
                debug: false,
                importCSS: true,
                importStyle: true,
                printContainer: true,
                loadCSS: "/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.css",
                pageTitle: "打印表单",
                removeInline: false,
                printDelay: 333,
                header: null,
                formValues: true
            });
        };
        var app = new Vue({
            el: '#DATABI_YBZZ',
            components: {

            },
            data: {
                vtype: ComFunJS.getQueryString('vtype', '0'),
                piid: ComFunJS.getQueryString('piid', '0'),
                pddata: {},
                pidata: {},
                formLabelWidth: '120px',
                poption: { width: '0' },
                FormCode: "BDGL",
                FormFile: [],
                FormDecVisible: false,
                dialogCanVisible: false,
                tdpro: { shname: "审核" },
                canlx: "0",
                canyj: "",
                formtemp: "",
                formtatus: "0",
                bodyopacity: 95,
                tabtype: "0",
                isview: false,//是否浏览模式,判断需不需要加载默认值
                nowwidget: {},
                wfdata: [],
                readySize: 0,//组件加载数据
                NoValData: [],//不需要验证字段
                FormData: {
                    wigetitems: []
                },
                qxdata: { ISCANSP: "N", ISCANCEL: "N" },
                nowwidget: {
                },
                zduser: [],
                zsr: '',
                lcshow: false,
                taskorder: '0',
                tatag: true,

            },
            computed: {
                //isrebackone() {
                //    return app.wfdata[1].TIData == "";
                //}
            },
            methods: {
                on_click: function (item) {
                    alert(item.TaskName)
                },
                addchildwig() {
                    this.readySize++
                    // 检查进度是否设置的colSize一致
                    if (this.readySize == this.FormData.wigetitems.length) {
                        this.layout();
                    }
                },
                handleCommand(command) {
                    if (command == "CopyForm") {
                        this.CopyForm();
                    }
                    if (command == "UpdateTemp") {
                        this.UpdateTemp();
                    }
                    if (command == "Export") {
                        this.Export();
                    }
                    if (command == "Preview") {
                        Preview();
                    }
                    if (command == "zdh") {
                        this.zdh();
                    }
                    if (command == "qp") {
                        this.qp();
                    }
                },
                jxfiled: function (nowwidget, jxdata) {
                    var js = [];
                    if (_.isArray(jxdata)) {
                        js = jxdata || JSON.parse(nowwidget.staticdata);

                    } else {
                        js = JSON.parse(jxdata || nowwidget.staticdata);
                    }
                    nowwidget.tabfiledlist = [];
                    _.forEach(_.keys(js[0]), function (value) {
                        var fid = {
                            ColumnName: value,
                            ColumnType: "Str",
                            Dimension: "1",
                            Name: value,
                        }
                        if (_.findIndex(nowwidget.tabfiledlist, function (o) { return o.ColumnName == fid.ColumnName; }) == -1) {
                            nowwidget.tabfiledlist.push(fid);
                        }
                    });
                },//解析数据维度
                jxparam: function (val) {
                    //解析参数
                    var valsql = "";
                    if (val) {
                        valsql = val;
                        var regex2 = /\[(.+?)\]/g;
                        var temp = val.match(regex2);
                        _.forEach(temp, function (obj) {
                            var tempqval = "";
                            obj = _.trim(obj, '[');
                            obj = _.trim(obj, ']');
                            if (_.startsWith(obj, '&')) {
                                tempqval = ComFunJS.getQueryString(obj.split('&')[1]);
                                valsql = _.replace(valsql, '[' + obj + ']', tempqval);
                            }
                            if (_.startsWith(obj, '@')) {
                                tempqval = ComFunJS.getCookie(obj.split('@')[1]);
                                valsql = _.replace(valsql, '[' + obj + ']', tempqval);
                            }
                            if (_.startsWith(obj, '$')) {
                                var wig = _.find(app.FormData.wigetitems, function (o) {
                                    return o.wigdetcode == obj.split('$')[1];
                                })
                                tempqval = wig.value;//获取组件值
                                valsql = _.replace(valsql, '[' + obj + ']', tempqval);
                            }
                        })
                    }
                    return valsql;
                },
                getwiget: function (wiggetcode) {
                    var datawig = null;
                    _.forEach(app.FormData.wigetitems, function (item) {
                        if (item.wigdetcode == wiggetcode) {
                            datawig = item;
                        }
                    })
                    return datawig;
                },
                UpdateYBData: function (nowwidget) {
                    if (nowwidget.datatype == '2') {//静态数据
                        try {
                            if (nowwidget.staticdata) {
                                app.jxfiled(nowwidget, nowwidget.staticdata)
                                var js = JSON.parse(nowwidget.staticdata);
                                var lastdata = js;
                                nowwidget.dataset = lastdata;
                            }

                        } catch (e) {
                            app.$notify({
                                title: '失败',
                                message: '错误得JSON格式',
                                type: 'error'
                            });
                        }
                        return;
                    }

                    //需要先克隆一个对象,不然没法解析参数
                    var tempnow = _.cloneDeep(nowwidget);
                    if (tempnow.apiurl.indexOf("http:") == -1) {
                        tempnow.apiurl = window.document.location.origin + '/' + tempnow.apiurl;
                    }
                    if (tempnow.datatype == '3' || tempnow.datatype == '1') {
                        //处理存储过程和API得参数
                        _.forEach(tempnow.proqdata, function (obj) {
                            obj.pvalue = app.jxparam(obj.pvalue);
                        })

                    } else {
                        //处理查询参数
                        _.forEach(tempnow.wdlist, function (wd) {
                            if (wd.querydata.length > 0) {
                                _.forEach(wd.querydata, function (wdq) {
                                    wdq.glval = app.jxparam(wdq.glval);

                                })
                            }
                        })
                        //处理查询参数
                    }

                    $.getJSON('/api/Bll/ExeAction?Action=FORMBI_GETYBDATA', { P1: JSON.stringify(tempnow), pagecount: 0, pageNo: 0, pageSize: 0 }, function (resultData) {
                        if (!resultData.ErrorMsg) {
                            nowwidget.dataset = [];
                            if (nowwidget.datatype == "0") {
                                nowwidget.datatotal = resultData.DataLength;
                                nowwidget.dataset = resultData.Result;
                            } else {
                                if (resultData.Result) {
                                    try {
                                        if (nowwidget.datatype == "1" && nowwidget.apiurl.indexOf("http:") == -1) {
                                            resultData.Result = JSON.parse(resultData.Result).Result;//本地服务处理API
                                        }
                                        app.jxfiled(nowwidget, resultData.Result)
                                        var tempdata = [];
                                        if (_.isArray(resultData.Result)) {
                                            tempdata = resultData.Result;

                                        } else {
                                            tempdata = JSON.parse(resultData.Result);
                                        }
                                        var lastdata = app.datamange(tempdata, nowwidget);
                                        nowwidget.dataset = lastdata;
                                    } catch (e) {
                                        app.$notify({
                                            title: '失败',
                                            message: '获取数据格式错误',
                                            type: 'error'
                                        });
                                    }
                                }

                            }
                        }
                    })
                },
                layout: function () {
                    app.FormData.wigetitems.forEach(function (wig) {
                        if (wig.component == "qjTab") {
                            wig.childpro.Tabs.forEach((tab, index) => {
                                tab.content.forEach((tabitem, indexitem) => {
                                    $("#" + wig.wigdetcode).find(".el-tab-pane").eq(index).append($("#" + tabitem.wigdetcode));
                                })
                            })
                        }
                    })
                },
                zdh: function () {
                    $(".containerb").toggleClass("widthmax");
                    $(".elmain").toggleClass("pd40");
                    $(".elmain").toggleClass("pd0");

                },
                CopyForm: function () {
                    this.$confirm('此操作将会把此表单作为模板,重新发起表单,是否转到发起页面?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true

                    }).then(() => {
                        localStorage.setItem("copydata", JSON.stringify(app.FormData));
                        location.href = "/ViewV5/AppPage/FORMBI/FormAdd.html?iscopy=y&pdid=" + app.pddata.ID + "&r=" + Math.random();
                    }).catch(() => {

                    });
                },
                UpdateTemp: function () {
                    this.$confirm('此操作会将此表单更新到最新模板,可能会丢失部分数据,确定要更新吗?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true

                    }).then(() => {
                        var tempwigs = JSON.parse(app.formtemp);
                        _.forEach(tempwigs, function (temp) {
                            if (_.findIndex(app.FormData.wigetitems, function (wig) {
                                return wig.wigdetcode == temp.wigdetcode;
                            }) == -1) {
                                app.FormData.wigetitems.push(temp);
                            }
                        })
                    }).catch(() => {

                    });
                },
                changeop: function (val) {
                    $("body").css("opacity", "." + val);
                    localStorage.setItem("fopacity", val);
                },
                qp: function () {
                    if (document.isFullScreen || document.mozIsFullScreen || document.webkitIsFullScreen) {
                        ComFunJS.exitFullscreen()
                    } else {
                        ComFunJS.requestFullScreen();
                    }
                },
                stepstatus: function (taskstatus) {
                    switch (taskstatus) {
                        case "1":
                            return "success";
                            break;
                        case "-1":
                            return "danger";
                            break;
                        default:
                            return ""
                    }
                },
                SaveDraft: function () {
                    var draftdata = { "ID": "0", "FormCode": app.FormCode, "FormID": app.pddata.ID, "JsonData": "" };
                    draftdata.JsonData = JSON.stringify(app.FormData.wigetitems);
                    $.getJSON("/api/Bll/ExeAction?Action=FORMBI_SAVEDRAFT", { P1: JSON.stringify(draftdata) }, function (result) {
                        if (!result.ErrorMsg) {

                        }
                    })
                },
                SaveForm: function () {
                    this.$confirm('此操作将更新表单中的数据,是否继续?', '提示', {
                        confirmButtonText: '确定更新',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        if (app.piid != 0) {
                            $.getJSON("/api/Bll/ExeAction?Action=FORMBI_SAVEPIDATA", { P1: app.piid, P2: JSON.stringify(app.FormData.wigetitems) }, function (result) {
                                if (!result.ErrorMsg) {
                                    app.$notify({
                                        title: '成功',
                                        message: '更新表单成功',
                                        type: 'success'
                                    });
                                    if (app.pidata.PITYPE == "-1") {
                                        try {
                                            let jscode = app.poption.completecode;
                                            let func = new Function('piid', jscode);
                                            func(app.piid)
                                        } catch (e) {

                                        }
                                    }
                                }
                            });
                        }
                    }).catch(() => {
                        app.$message({
                            type: 'info',
                            message: '已取消更新操作'
                        });
                    });
                   
                },
                ManageForm: function () {
                    if (app.poption.mangecode) {
                        try {
                            let jscode = app.poption.mangecode;
                            let func = new Function('taskorder', jscode);
                            var mr = func(app.taskorder);
                            if (mr) {
                                return;
                            }
                        } catch (e) {

                        }
                    }

                    this.$refs.form.validate(function (boolean, object) {
                        if (app.NoValData.length > 0) {
                            app.$refs.form.clearValidate(app.NoValData);
                        }//遇到不需要验证得,先去除验证
                        if (_.difference(_.keys(object), app.NoValData).length == 0) {
                            app.$prompt('请输入意见', '提示', {
                                confirmButtonText: '确定',
                                cancelButtonText: '取消',
                                inputValue: "同意"
                            }).then(({ value }) => {
                                $.getJSON("/api/Bll/ExeAction?Action=FORMBI_MANAGEWF", { P1: app.piid, P2: value, formcode: app.FormCode, csr: "", content: JSON.stringify(app.FormData.wigetitems) }, function (result) {
                                    if (!result.ErrorMsg) {
                                        app.$notify({
                                            title: '成功',
                                            message: '审核完毕',
                                            type: 'success'
                                        });
                                        app.qxdata = { ISCANSP: "N", ISCANCEL: "N" };
                                        app.formtatus = "1";
                                    }
                                });
                            }).catch(() => {

                            });
                        }
                    })
                },
                ReForm: function () {
                    if (!app.zsr) {
                        app.$message({
                            type: 'info',
                            message: '请选择转审人员'
                        });
                        return;
                    }
                    app.$prompt('请输入转审意见', '提示', {
                        confirmButtonText: '确定转审',
                        cancelButtonText: '取消',
                        inputValue: ""
                    }).then(({ value }) => {
                        $.getJSON("/api/Bll/ExeAction?Action=FORMBI_MANAGEWF", { P1: app.piid, P2: value, zsr: app.zsr, formcode: app.FormCode, csr: "", content: JSON.stringify(app.FormData.wigetitems) }, function (result) {
                            if (!result.ErrorMsg) {
                                app.$notify({
                                    title: '成功',
                                    message: '转审完毕',
                                    type: 'success'
                                });
                                app.qxdata = { ISCANSP: "N", ISCANCEL: "N" };
                                app.formtatus = "1";
                            }
                        });
                    }).catch(() => {
                        app.$message({
                            type: 'info',
                            message: '已取消转审操作'
                        });
                    });
                },
                CanCel: function () {
                    this.$confirm('此操作将彻底删除该表单相关数据,是否继续?', '提示', {
                        confirmButtonText: '确定撤回',
                        cancelButtonText: '取消',
                        type: 'warning',
                        center: true
                    }).then(() => {
                        $.getJSON("/api/Bll/ExeAction?Action=FORMBI_CANCELWF", { P1: app.piid, ModelCode: app.FormCode }, function (result) {
                            if (!result.ErrorMsg) {//流程数据
                                app.qxdata.ISCANCEL = "N";
                                app.SaveDraft();
                                app.$message({
                                    type: 'success',
                                    message: '已删除成功'
                                })
                            }
                        })

                    }).catch(() => {
                        app.$message({
                            type: 'info',
                            message: '已取消撤回操作'
                        });
                    });
                },
                ReBack: function () {
                    app.dialogCanVisible = true;
                },
                ConReBack: function () {
                    if (!app.canyj) {
                        app.$notify({
                            title: '警告',
                            message: '请输入意见',
                            type: 'warning'
                        });
                    } else {
                        $.getJSON("/api/Bll/ExeAction?Action=FORMBI_REBACKWF", { P1: app.piid, P2: app.canyj, formcode: app.FormCode, cantype: app.canlx }, function (result) {
                            if (!result.ErrorMsg) {
                                app.$notify({
                                    title: '成功',
                                    message: '操作成功',
                                    type: 'success'
                                });
                                location.reload()
                            }
                        });
                    }

                },
                RemindForm: function () {

                },
                Export: function () {
                    //location.href = "/api/Bll/EXPORTWORD?P1=" + app.pddata.ID + "&P2=" + app.piid;
                    $.getJSON("/api/Bll/ExeAction?Action=FILE_EXPORTWORD", { P1: app.pddata.ID, P2: app.piid }, function (result) {
                        location.href = "/Export/" + result.Result;
                    })
                },
                initwf: function () {
                    $.getJSON("/api/Bll/ExeAction?Action=FORMBI_GETMANGWFDATA", { P1: app.piid }, function (result) {
                        if (result.ErrorMsg == "") {

                            app.formtemp = result.Result1.Tempcontent;
                            var wigs = JSON.parse(result.Result3.Content);
                            app.wfdata = result.Result;
                            app.pddata = result.Result1;
                            app.qxdata = JSON.parse(result.Result2);
                            app.pidata = result.Result3;
                            app.FormFile = result.Result4;
                            app.taskorder = result.Result5;
                            if (app.pddata.Poption) {
                                app.poption = JSON.parse(app.pddata.Poption);
                            }

                            app.FormData.wigetitems = wigs;
                            _.forEach(app.FormData.wigetitems, function (wiget) {
                                wiget.childpro.disabled = false;

                            })


                        }
                    })

                },
                datamange: function (data, nowwidget) {
                    const dv = new DataSet.View().source(data);
                    var redata = [];

                    //数据过滤
                    //获取数据筛选条件
                    var qdata = [];
                    _.forEach(nowwidget.wdlist, function (wd) {
                        if (wd.querydata.length > 0) {
                            _.forEach(wd.querydata, function (wdq) {
                                qdata.push({ colid: wd.colid, cal: wdq.cal, glval: wdq.glval });
                            })
                        }
                    })
                    _.forEach(qdata, function (q) {
                        var calval = app.jxparam(q.glval);
                        if (calval) {
                            switch (q.cal) {
                                case "0":    //等于
                                    {
                                        dv.transform({
                                            type: 'filter',
                                            callback(row) { // 判断某一行是否保留，默认返回true
                                                return row[q.colid] == calval;
                                            }
                                        });
                                    }
                                    break;
                                case "1":    //小于
                                    {
                                        dv.transform({
                                            type: 'filter',
                                            callback(row) { // 判断某一行是否保留，默认返回true
                                                return row[q.colid] < calval;
                                            }
                                        });
                                    }
                                    break;
                                case "2":    //大于
                                    {
                                        dv.transform({
                                            type: 'filter',
                                            callback(row) { // 判断某一行是否保留，默认返回true
                                                return row[q.colid] > calval;
                                            }
                                        });
                                    }
                                    break;
                                case "3":    //小于
                                    {
                                        dv.transform({
                                            type: 'filter',
                                            callback(row) { // 判断某一行是否保留，默认返回true
                                                return row[q.colid] != calval;
                                            }
                                        });
                                    }
                                    break;
                                case "4":    //包含
                                    {
                                        dv.transform({
                                            type: 'filter',
                                            callback(row) { // 判断某一行是否保留，默认返回true
                                                return row[q.colid].indexOf(calval) > -1;
                                            }
                                        });
                                    }
                                    break;
                                default: {

                                }
                            }
                        }
                    })
                    var filds = _.map(nowwidget.wdlist, 'colid');
                    if (filds.length > 0) {
                        dv.transform({
                            type: 'pick',
                            fields: filds // 决定保留哪些字段，如果不传，则返回所有字段
                        });
                    }
                    redata = dv.rows;
                    return redata;
                },
                ref: function () {
                    location.reload();
                },
            },
            created() {
                document.body.removeChild(document.getElementById('Loading'))
                var divBJ = document.getElementById('DATABI_YBZZ');
                divBJ.style.display = "block";
            },

            mounted: function () {
                var pro = this;
                pro.$nextTick(function () {
                    var wigdata = ComFunJS.formcomponents;
                    for (var i = 0; i < wigdata.length; i++) {
                        pro.$options.components[wigdata[i].wigcode] = httpVueLoader(wigdata[i].wigurl);
                    }
                    if (!ComFunJS.isPC()) {
                        pro.vtype = "1";
                        $("#FormFoot").addClass("FormFoot");
                        $(".el-dialog").width("90%");
                    }
                    if (pro.vtype == "2") {
                        $("#FormFoot").addClass("FormFoot");
                        //弹框模式,添加底部按钮样式,去除背景
                    }
                    pro.initwf();
                    if (pro.vtype == "1" || pro.vtype == "2") {
                        pro.zdh();
                    }
                    if (pro.vtype == "0") {
                        $("body").css("background-color", "#e4e7ed");
                        $("body").css("background-image", "url(/ViewV5/images/skin/skin7.jpg)");
                    }

                })
            }

        })
    </script>

</body>

</html>